package com.link.base.microinterface.core;

import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @author HuangLJ
 * @Date 2019-03-21 20:08
 * @throws Exception
 * @Comments baseClients 包含了所有标准方法的基础client
 * @Version 1.0
 */

public interface BaseClients {

    /**
     * @author HuangLJ
     * @date 2019-03-23 10:19
     * @param
     * @return
     * @throws Exception 报错
     * @comments 查询所有接口
     */
    @PostMapping("/queryAll")
    public Map<String, Object> queryAll(@RequestParam("parameters") Map<String, Object> parameters);

    /**
     * @author HuangLJ
     * @date 2019-03-23 10:19
     * @param
     * @return
     * @throws Exception 报错
     * @comments 查询所有接口
     */
    @PostMapping("/queryFieldsByExamplePage")
    public Map<String, Object> queryFieldsByExamplePage(@RequestParam("parameters") Map<String, Object> parameters);


    /**
     * @author HuangLJ
     * @date 2019-03-23 10:19
     * @param
     * @return
     * @throws Exception 报错
     * @comments 导出数据
     */
    @PostMapping("/queryByExamplePage/exportData")
    public Map<String, Object> exportData(@RequestParam("parameters") Map<String, Object> parameters);


    /**
     * @author HuangLJ
     * @date 2019-03-23 10:19
     * @param
     * @return
     * @throws Exception 报错
     * @comments 深度复制
     */
    @PostMapping("/deepCopy")
    public Map<String, Object> deepCopy(@RequestParam("parameters") Map<String, Object> parameters);


    /**
     * @author HuangLJ
     * @date 2019-03-23 10:19
     * @param
     * @return
     * @throws Exception 报错
     * @comments 插入数据
     */
    @PostMapping("/insert")
    public Map<String, Object> insert(JSONObject jsonObject);

    /**
     * @author HuangLJ
     * @date 2019-03-23 10:19
     * @param
     * @return
     * @throws Exception 报错
     * @comments 插入更新
     */
    @PostMapping("/upsert")
    public Map<String, Object> upsert(JSONObject jsonObject);

    /**
     * @author HuangLJ
     * @date 2019-03-23 10:19
     * @param
     * @return
     * @throws Exception 报错
     * @comments 更新数据
     */
    @PostMapping("/update")
    public Map<String, Object> update(JSONObject jsonObject);

    /**
     * @author HuangLJ
     * @date 2019-03-23 10:19
     * @param
     * @return
     * @throws Exception 报错
     * @comments 基于Id删除
     */
    @PostMapping("/deleteById")
    public Map<String, Object> deleteById(JSONObject jsonObject);


    /**
     * @author HuangLJ
     * @date 2019-03-23 10:19
     * @param
     * @return
     * @throws Exception 报错
     * @comments 基于Id查询
     */
    @PostMapping("/queryById")
    public Map<String, Object> queryById(JSONObject jsonObject);
}
